package cn.alm.serviceproduct.service.impl;

import cn.alm.serviceproduct.entity.Product;
import cn.alm.serviceproduct.service.ProductService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;

@Service
public class ProductServiceImpl implements ProductService {
    @Override
    public Product getProductById(Long id) {
        Product product = new Product();
        product.setId(id);
        product.setNum(100);
        product.setProductName("华为手机");
        product.setPrice(new BigDecimal(9999));
        System.out.println("查询商品信息成功");

//        try {
//            TimeUnit.SECONDS.sleep(100);
//        } catch (InterruptedException e) {
//            throw new RuntimeException(e);
//        }

        return product;
    }
}
